package net.esj.basic.utils.view;


public class BaseJsonMessage {

	private String title;
	private String msg;
	private MessageLevel level;
	
	private static final  MessageLevel DEFAULT_LEVEL = MessageLevel.INFO;
	
	public BaseJsonMessage(String msg) {
		this(msg,DEFAULT_LEVEL);
	}
	
	public BaseJsonMessage(String msg, MessageLevel level) {
		this("",msg,level);
	}
	
	public BaseJsonMessage(String title,String msg) {
		this(title,msg,DEFAULT_LEVEL);
	}
	
	public BaseJsonMessage(String title, String msg, MessageLevel level) {
		this.title = title;
		this.msg = msg;
		this.level = level;
	}
	
	public String getLevel() {
		return level.getLevel();
	}
	public void setLevel(MessageLevel level) {
		this.level = level;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	
	public enum MessageLevel{
		INFO("info"),ERROR("error"),WARNING("warning"),QUESTION("question"),NULL("");
		
		private String level;

		MessageLevel(String level) {
			this.level = level;
		}
		
		public String getLevel() {
			return level;
		}
		
	}
	
}
